/**
 * 
 */
package com.p2p.front.result;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.p2p.base.result.BaseResult;
import com.p2p.trans.client.enums.TransResultEnum;

/**
 * @author ruiqi
 *
 */
public class TransferResult extends BaseResult{
	
	

	public enum ResultCodeEnum{
		transfer_parameters_error("参数错误"),
		transfer_system_exception("系统异常"),
		transfer_common_error("通用错误"),
		transfer_password_error("通用错误"),
		transfer_status_error("转让状态错误"),
		;
		
		private String desc;
		
		private ResultCodeEnum(String desc) {
			this.desc = desc;
		}
		public String getDesc() {
			return desc;
		}
		
	}
	public class TransferException extends RuntimeException{
		
		private ResultCodeEnum   code             = null;

	    /**
	     * @param code
	     */
	    public TransferException(ResultCodeEnum code) {
	        super();
	        this.code = code;
	    }

	    /**
	     * @param code
	     * @param e
	     */
	    public TransferException(ResultCodeEnum code, Throwable e) {
	        super(e);
	        this.code = code;
	    }

	    /**
	     * @return Returns the code.
	     */
	    public ResultCodeEnum getCode() {
	        return code;
	    }

	    /**
	     * @param code The code to set.
	     */
	    public void setCode(ResultCodeEnum code) {
	        this.code = code;
	    }

	    /* (non-Javadoc)
	     * @see java.lang.Throwable#toString()
	     */
	    @Override
	    public String toString() {
	        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	    }
	}
}
